package com.xunlai.infra.permission.business.dao.repository;

import com.xunlai.infra.permission.business.dao.entity.RouteIntroduction;
import com.xunlai.infra.permission.storage.repository.BaseAllRoundRepository;
import org.springframework.data.jdbc.repository.query.Modifying;
import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author liang
 * @date 8/2/23 4:13 PM
 */
@Transactional(rollbackFor = Exception.class)
public interface RouteIntroductionRepository extends BaseAllRoundRepository<RouteIntroduction,Long> {


    @Query("delete from travel_route_introduction where route_id = :routeId")
    @Modifying
    void deleteByRouteId(@Param("routeId") Long routeId);


    @Query("delete from travel_route_introduction where route_id in (:routeIds)")
    @Modifying
    void deleteAllByRouteIdIn(@Param("routeIds") List<Long> routeIds);
}
